-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add Preview/Draft Layout Wrapper for Testing Links #4090
base: main
Are you sure you want to change the base?
Conversation
editor.planx.uk/src/@planx/components/shared/Preview/NavigateToPublishedButton.tsx
Outdated
Show resolved
Hide resolved
editor.planx.uk/src/@planx/components/shared/Preview/NavigateToPublishedButton.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good!
A few comments to take a look at 👍
editor.planx.uk/src/@planx/components/shared/Preview/NavigateToPublishedButton.tsx
Outdated
Show resolved
Hide resolved
editor.planx.uk/src/@planx/components/shared/Preview/NavigateToPublishedButton.tsx
Outdated
Show resolved
Hide resolved
30fbf51
to
a2d1a18
Compare
editor.planx.uk/src/@planx/components/shared/Preview/NavigateToPublishedButton.tsx
Outdated
Show resolved
Hide resolved
One question related to this point:
What happens when the I don't think I actually agree that this is intended behavior, and I think users should be dropped at the beginning of a published service when clicking this link rather than midway? |
@jessicamcinchak yeah, I wasn't sure on this, thanks for the clarification, I'll reset back to start on this |
0203d71
to
c69cf29
Compare
What does this PR do?
This PR adds a wrapper around the Preview and Draft view to initially show a 'This is a test environment' node that a user would have to navigate past.
For this PR, I used the
Layout
pattern as a guide, but just used aPage
rather than aLayout
to wrap theView
. I started with theLayout
in place of thePage
below but it didn't contain any extra logic or anything useful, so I removed it.I used the Save and Return journey as a guide and created a new component inside the
Card
component to control whichOr
route is used. This has all been decoupled from theCard
component and added to theOrNavigationButton
Hopefully this is an elegant solution and I have overcomplicated this
<OrNavigationButton>
. An unintended consequence of this is that theGo to live link
is now present as anOr
option on theSend
component. This is why I had to mock the react-navi import for the testsImportant
When clicking "Go to published..." the flow data is deleted from localStorage and window is reset similar to the
Restart
button while you are navigated to the published?analytics=false page